#define _CRT_SECURE_NO_WARNINGS 1
#include "mystdio.h"
#include <string.h>
#include <unistd.h>

const char* filename = "./log.txt";

int main()
{
	myFILE* fp = my_fopen(filename, "w");
	if (fp == NULL) return 1;

	int cnt = 5;
	char buffer[64];
	while (cnt)
	{
		snprintf(buffer, sizeof(buffer), "helloworld,hellobit,%d  ", cnt--);
		my_fwrite(fp, buffer, strlen(buffer));
		//DebugPrint(fp);
		my_fflush(fp);
		sleep(2);
	}

	my_fclose(fp);
	return 0;
}
